import request from '@/utils/request'
import uniFiler from '@/components/libs/uni-filer.js'

// 查询数据表
export function queryTables (query) {
  return request({
    url: '/system/appDataApi/mplist',
    method: 'get',
    params: query
  })
}

// 查询配置表数据
export function queryTableData ({ url, query } = {}) {
  return request({
    url: url,
    method: 'get',
    params: query
  })
}

// 查询系统配置
export function querySystemConfigData (query) {
  return request({
    url: '/system/config/mplist',
    method: 'get',
    params: query
  })
}

// 查询字典数据
export function queryDictData (query) {
  return request({
    url: '/system/dict/data/mplist',
    method: 'get',
    params: query
  })
}

// 查询养护路段数据
export function queryMaintainSectionsData (query) {
  return request({
    url: '/maintain/maintainSections/mplist',
    method: 'get',
    params: query
  })
}

// 查询合同适用路段数据
export function queryContractSectionsData (query) {
  return request({
    url: '/maintain/contractSections/mplist',
    method: 'get',
    params: query
  })
}

// 查询合同路段养护方法数据
export function queryContractSectionItemsData (query) {
  return request({
    url: '/maintain/contractSectionItems/mplist',
    method: 'get',
    params: query
  })
}

// 上传图片
export function uploadImage({ params, vm }) {
  return uniFiler.uploadFile({
    url: vm.vuex_config.baseUrl + '/common/upload',
    params,
    vm
  })
}

// 查询应用版本
export function queryAppVersion (query) {
  return request({
    url: '/system/appVersion/getNewVersion/android',
    method: 'get',
    params: query,
		showLoading: false
  })
}

// 查询应用菜单
export function queryAppRoutes (query) {
  return request({
    url: '/getMobileRouters',
    method: 'get',
    params: query
  })
}
